home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 1 / Gold Medal Software Volume 1 (Gold Medal) (1994).iso / prog / dasv10_.arj / INTRUDER.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-10  |  950 b   |  36 lines

  1. // intruder.cpp
  2. // 1993 DAS Software Publications
  3. #include <iostream.h>
  4. #include <iomanip.h>        // for setw()
  5. #include <process.h>        // for exit()
  6. #include <conio.h>            // for getche()
  7. #include <dos.h>            // for sound(), nosound(), etc.
  8.  
  9. void main()
  10. { // begin main program
  11.     int i, j;
  12.  
  13.     for (j=1; j<=12; j++) // begin for
  14.         cout << '\n';
  15.     cout << setw(58) << "** STAND BY FOR SECURITY CLEARANCE **" << endl;
  16.     for (j=1; j<=12; j++) // begin for
  17.         cout << '\n';
  18.  
  19.     for (j=1; j<=10; j++) { // begin for
  20.         for (i=500; i<=700; i++) { // begin if
  21.             sound(i);                // activate siren
  22.             delay(4);
  23.         } // end if
  24.         if (getche()=='1') {        // begin if
  25.             nosound();
  26.             exit(0);                // exit if user ok
  27.         } // end if
  28.     } // end for
  29. LOOP: // if intruder, lock system
  30. cout << setw(45) << "***** INTRUDER ALERT!!!!! *****" << endl;
  31. cout << setw(53) << "Unauthorized User Detected!" << endl;
  32. nosound();
  33. //goto LOOP;
  34. } // end program
  35.  
  36.